/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package intelligenttm.SourceFile;

import java.awt.Color;
import javax.swing.JColorChooser;

/**
 *
 * @author 望舒凌霄
 */
public class MyColorChooser {
    private Color color;
    public MyColorChooser() {
        this.color =JColorChooser.showDialog(null,"颜色选择",new Color(200,200,200)); 
    }
    public int GetR(){
        return color.getRed();
    }
    public int GetG(){
        return color.getGreen();
    }
    public int GetB(){
        return color.getBlue();
    }
    public int GetA(){
        return color.getAlpha();
    }
    public boolean isNull(){
        return color==null;
    }
    public int[] GetRGB(){
        int[] rgb=new int[3];
        rgb[0]=color.getRed();
        rgb[1]=color.getGreen();
        rgb[2]=color.getBlue();
        return rgb;
    }
    public float[] GetRGBA(){
        float[] rgb=new float[4];
        rgb[0]=color.getRed();
        rgb[1]=color.getGreen();
        rgb[2]=color.getBlue();
        rgb[3]=color.getAlpha();
        return rgb;
    }

    public Color getColor() {
        return color;
    }
    
}
